package com.example.oss.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;

public class OssActive {

    private final OSSProperties ossProperties;
    public OssActive(OSSProperties ossProperties){
        this.ossProperties = ossProperties;
    }

    //根据字段的值动态选择oss平台配置
    @Bean
    @ConditionalOnProperty(name = "oss.platform", havingValue = "aliyun")
    public AliyunOssConfig aliyunConfiguration() {
        return new AliyunOssConfig(ossProperties);
    }

    //其他云
    //还没写


}
